<?php
/**
 * File htdocs/Aplication/Models/updateque.php ini berisi class Updateque
 *
 * PHP version 5.3
 *
 * @category Models
 * @package  Htdocs/Aplication/Models
 * @author   dio ratar <dio.22ratar@gmail.com>
 * @license  FamilyTree
 * (http://en.wikipedia.org/wiki/Proprietary_software)
 * @link     http://www.FamilyTree.dio22r.com/
 */

if ( ! defined('BASEPATH')) exit('No direct script access allowed');


/**
 * pengisian form :
 * tambah :
 * 1. pilih mau nambah anak ato pasangan...
 * 2. pilih pasangan/anaknya siapa....
 * 3. isi form...
 * 4. upload foto... boleh di skip...
 * 5. view bio...
 * 6. close...
 * 
 *  
 *  edit :
 *  1. lansung klik di nama
 *  2. tampil view bio...
 *  3. edit or close...
 *  4. edit : isi form...
 *  5 view bio...
 */

/**
 * Class updateque merupakan class yang berisi perintah-perintah SQL 
 * yang digunakan untuk update.
 *
 * @category Models
 * @package  Htdocs/Aplication/Models
 * @author   dio ratar <dio.22ratar@gmail.com>
 * @license  FamilyTree
 * (http://en.wikipedia.org/wiki/Proprietary_software)
 * @link     http://www.FamilyTree.dio22r.com/
 */
class form_bio extends CI_Controller
{
	
	public function __construct()
	{
		parent::__construct();
		$this->load->helper("html");
		$this->load->helper("form");
		$this->load->model("selectque", "select");
	}
	
	public function form_edit($mode = "new", $id = "")
	{
		if ("new" == $mode) {
			$arrData = array (
				'nama' => '',
				'tempat_lahir' => '',
				'tanggal_lahir' => '',
				'jenis_kelamin' => '',
				'lokasi_skrg' => ''
			);
			$viewData = array (
				'ctlArrData' => $arrData,
				'ctlSubmitMode' => "add"
			);
		} else if ("edit" == $mode) {
			$arrRes = $this->select->bio($id);
			$arrData = array (
				'nama' => $arrRes['nama'],
				'tempat_lahir' => $arrRes['tempat_lahir'],
				'tanggal_lahir' => $arrRes['tanggal_lahir'],
				'jenis_kelamin' => $arrRes['jenis_kelamin'],
				'lokasi_skrg' => $arrRes['lokasi_skrg']
			);
			$viewData = array (
				'ctlArrData' => $arrData,
				'ctlSubmitMode' => "edit"
			);
		}
		
		
		$this->load->view('form_bio', $viewData);
	}
	
	public function form_new()
	{
		$this->load->view('form_bio_new', $viewData);
	}
	
	function _get_submit()
	{
		$isSubmit = $this->input->post('submit', true);
		
		if ($isSubmit) {
			$arrPost = $this->input->post();

			print_r($arrPost);
		} else {
			
		}
	}
	
	function show_bio($id)
	{
		
	}
	
}